# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=autorandr
pkgver=1.13.3
pkgrel=1
pkgdesc="Auto-detect connected display hardware and load appropiate X11 setup using xrandr"
arch=(any)
url="https://github.com/phillipberndt/autorandr"
license=(GPL3)
depends=(python-packaging xorg-xdpyinfo xorg-xrandr)
makedepends=(bash-completion desktop-file-utils systemd)
optdepends=(
  'bash-completion: auto-completion for autorandr in Bash'
  'zsh-completions: auto-completion for autorandr in ZSH'
)
source=($pkgname-$pkgver.tar.gz::https://github.com/phillipberndt/$pkgname/archive/$pkgver.tar.gz)
sha512sums=('6c3f99da52a029a8f1717020ebafbd7afb58d97651776a6620f47e299584704ab65c37be5e9497cca3c53d6268ebde11481f32967ec289adf606a73e587e874f')
b2sums=('fb53316af4d3fa399f278be874e95d06cbd188bebf1e22793ca30ad4f9a8817674390c7d02d501f4a35a0a6f23b16202e97f2a6559727e67e908d21121de8a56')

package() {
  make DESTDIR="$pkgdir" PREFIX=/usr install -C $pkgname-$pkgver
  # zsh completion
  install -vDm 644 $pkgname-$pkgver/contrib/zsh_completion/_$pkgname -t "$pkgdir/usr/share/zsh/site-functions/"
  # docs
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
